<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	template="/pages/template/template.xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:t="http://myfaces.apache.org/tomahawk"
    xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
    
	<ui:define name="pageTitle">Web Chat - Controle Atendimento</ui:define>
	
	<ui:define name="conteudo">
	<t:saveState value="#{atendenteBean.funcionario}" ></t:saveState>
		<div class="linhaTipoA">
			<a4j:poll interval="3000" reRender="tabelaClientes" />
			<h:dataTable id="tabelaClientes" var="item" columnClasses="center" headerClass="cabecalhoPrincipal" 
			value="#{atendenteBean.listaCliente}">	
				<f:facet name="header" >
						Clientes para Atendimento
				</f:facet>
				
				<t:column headerstyleClass="cabecalhoSecundario" >
					<f:facet name="header" >
						Nome
					</f:facet>
					<h:outputText value="#{item.nome}" />
				</t:column>
			</h:dataTable>
			</div>
		
		<div class="boxBotoes">
			<h:commandButton value="Iniciar Atendimento" styleClass="botaoPrincipal"
				action="#{atendenteBean.iniciarAtendimento}" rendered="#{not atendenteBean.isAtendimentoIniciado}">
				<f:setPropertyActionListener target="#{chatBean.pessoaVisivel}" value="#{atendenteBean.funcionario}"></f:setPropertyActionListener>
			</h:commandButton>
			<h:commandButton value="Parar Atendimento" styleClass="botaoSecundario"
				action="#{atendenteBean.pararAtendimento}" rendered="#{atendenteBean.isAtendimentoIniciado}"/>
		</div>
	</ui:define>
</ui:composition>